//
//  OrderStateViewController.m
//  waiMai
//
//  Created by LONG on 16/4/20.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "OrderStateViewController.h"
#import "StateTableViewCell.h"
@interface OrderStateViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UITableView *myTableView;
@end

@implementation OrderStateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"订单状态";
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"arrow"] style:UIBarButtonItemStylePlain target:self action:@selector(back)];
    [self.navigationItem.leftBarButtonItem setTintColor:[UIColor whiteColor]];
    self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    self.navigationController.interactivePopGestureRecognizer.delegate =(id)self;
    self.view.backgroundColor = UIColorFromRGB(0xefeff1);

    [self myTableView];
}
- (UITableView *)myTableView{
    if (nil == _myTableView){
        _myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT-115)];
        _myTableView.backgroundColor = UIColorFromRGB(0xefeff1);
        _myTableView.delegate = self;
        _myTableView.dataSource = self;
        _myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        [_myTableView registerNib:[UINib nibWithNibName:@"StateTableViewCell" bundle:nil] forCellReuseIdentifier:@"StateTableViewCell"];
        
        [self.view addSubview:_myTableView];
    }
    return _myTableView;
}

#pragma mark tableView代理

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    StateTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"StateTableViewCell" forIndexPath:indexPath];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    if (indexPath.row == 0) {
        cell.up.hidden = YES;
    }else if (indexPath.row == 4){
        cell.next.hidden = YES;
    }
    
    return cell;
}

#pragma mark delegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return 80;
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
}


-(void)back{
    [self.navigationController popViewControllerAnimated:YES];
}
@end
